<%@ page contentType="text/html;charset=UTF-8" %>
<table>
    <tr>
        <td style="min-width: 70px">Name</td>
        <td style="min-width: 100px">Surname</td>
        <td style="min-width: 20px">Age</td>
        <td style="min-width: 30px"></td>
    </tr>

    <g:each in="${persons}" var="person">
        <tr>
            <td>${person.name}</td>
            <td>${person.surname}</td>
            <td>${person.age}</td>
            <td>
                <input type="button" class="more_info" value="More info" onclick="showDetails(${person.id})">
            </td>
        </tr>
    </g:each>

    <g:if test="${persons.size() == 0}">
        <tr>
            <td>-</td>
            <td>-</td>
            <td>-</td>
            <td>-</td>
        </tr>
    </g:if>
</table>

<div id="pagination">
    <g:paginate action="index" total="${personCount}" next="Next" prev="Prev"/>
</div>